
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/public/header/permissionCommon.jspf" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="itheima" uri="http://ChanghuXian.com/common/"%>



<html>
<head>
    <title>设备档案管理</title>
    <link href="${webPath}/css/Sign/bootstrap.min.css" rel="stylesheet">
    <%@include file="/resources/commons/basejs.jsp" %>
</head>
<body class="layui-layout-body" onload="load()">
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>

    <!--右侧主体区域-->
    <div class="layui-body">

        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">设备档案</li>

            </ul>
        </div>

        <table id="id_table" lay-filter="lineToolFilter"></table>


    </div>




    <!--底部-->
    <div id="footer"></div>
    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>
    <script type="text/javascript" src="${webPath}/js/permission/dateUtils.js"></script>

</div>
</body>

<script>
    var modleName = "${ctxPath}/shebei";
    //用layui加载数据
    function onLayuiInit() {
        //渲染表格
        renderTable({
            elem: '#id_table',
            id: 'id_table',
            toolbar: '#toolBar2',

            url: modleName+"/getList",


            cols:[[
                {type:'checkbox',LAY_CHECKED:false},
                {field:'id',title:'编号',align:'center'},
                {field:'name',title:'设备ID',align: 'center'},
                {field:'jigou',title:'所属机构',align: 'center'},



                {field:'state',title:'设备状态',align:'center',templet:function (d) {
                        if(d.state==1){
                            return "<input type='checkbox' lay-filter='switchState' name='"+d.id+"' lay-skin='switch' lay-text='使用中|未使用'>";
                        }else{
                            return "<input type='checkbox' lay-filter='switchState' name='"+d.id+"' lay-skin='switch' lay-text='使用中|未使用' checked>";
                        }
                    }
                },
                {field:'createTime',title:'创建时间',align: 'center',templet:function (d) {
                        return layui.util.toDateString(d.createTime);
                    }
                },
                {field:'updateTime',title:'修改时间',align: 'center',templet:function (d) {
                        return layui.util.toDateString(d.updateTime);
                    }
                },
                {field:'type',title:'备注',align: 'center'},
                {title:'操作',align: 'center',toolbar:'#bar'}
            ]]


        });
        //使用父类的航工具栏
        useParentToolEvent(modleName);
    }



</script>
</html>
